
INFRASTRUCTURE_FILE_EXTENTION 	= c
INFRASTRUCTURE_SRC_PATH     	= $(MAIN_INFRASTRUCTURE_PATH)/source
INFRASTRUCTURE_OBJS_PATH    	= $(MAIN_OBJS_PATH)/INFRASTRUCTURE
INFRASTRUCTURE_DEPS_PATH		= $(MAIN_DEPS_PATH)/INFRASTRUCTURE
INFRASTRUCTURE_CFLAGS			= $(MAIN_CODE_CFLAGS)
INFRASTRUCTURE_DEPEND_CFLAGS	= $(MAIN_DEPEND_CFLAGS)

INFRASTRUCTURE_INCLUDE = $(addprefix -I, $(INFRASTRUCTURE_INCLUDE_PATH))
INFRASTRUCTURE_SRCS   = $(wildcard $(INFRASTRUCTURE_SRC_PATH)/*.$(INFRASTRUCTURE_FILE_EXTENTION))
INFRASTRUCTURE_OBJS   = $(addprefix $(INFRASTRUCTURE_OBJS_PATH)/,$(notdir $(subst .$(INFRASTRUCTURE_FILE_EXTENTION),.o,$(INFRASTRUCTURE_SRCS))))
INFRASTRUCTURE_DEPS	  = $(addprefix $(INFRASTRUCTURE_DEPS_PATH)/,$(notdir $(subst .$(INFRASTRUCTURE_FILE_EXTENTION),.d,$(INFRASTRUCTURE_SRCS))))
ALL_OBJS 	 += $(INFRASTRUCTURE_OBJS)
ALL_DEPS	 += $(INFRASTRUCTURE_DEPS)

$(INFRASTRUCTURE_DEPS_PATH)/%.d : $(INFRASTRUCTURE_SRC_PATH)/%.$(INFRASTRUCTURE_FILE_EXTENTION)
	@$(MKDIR) $(INFRASTRUCTURE_DEPS_PATH)
	@echo Making $(notdir $@) ...
	@$(CC) $(INFRASTRUCTURE_DEPEND_CFLAGS) $(INFRASTRUCTURE_INCLUDE) $< | sed 's/$*.o:/$(subst /,\/,$(INFRASTRUCTURE_OBJS_PATH))\/$*.o:/g' > $@
	@echo Done!

-include $(INFRASTRUCTURE_DEPS)

$(INFRASTRUCTURE_OBJS_PATH)/%.o : $(INFRASTRUCTURE_SRC_PATH)/%.$(INFRASTRUCTURE_FILE_EXTENTION)
	@$(MKDIR) $(INFRASTRUCTURE_OBJS_PATH)
	@echo Making $(notdir $@) ...
	@$(CC) $(INFRASTRUCTURE_CFLAGS) $(INFRASTRUCTURE_INCLUDE) $< -c -o $@
	@echo Done!


